home *** CD-ROM | disk | FTP | other *** search
/ PD ROM 1 / PD ROM Volume I - Macintosh Software from BMUG (1988).iso / Stacks / Hyper Education / Mathematics / Subtraction / card_7124.txt < prev    next >
Encoding:
Text File  |  1988-04-19  |  11.4 KB  |  495 lines

  1. -- card: 7124 from stack: in
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 6762
  5. -- name: 
  6.  
  7.  
  8. -- part 1 (button)
  9. -- low flags: 00
  10. -- high flags: 0001
  11. -- rect: left=14 top=87 right=178 bottom=110
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 1
  15. -- font id: 0
  16. -- text size: 12
  17. -- style flags: 0
  18. -- line height: 16
  19. -- part name: Smiley
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: 0001
  25. -- rect: left=251 top=87 right=180 bottom=351
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Frowney
  34.  
  35.  
  36. -- part 3 (button)
  37. -- low flags: 00
  38. -- high flags: 8003
  39. -- rect: left=354 top=102 right=139 bottom=468
  40. -- title width / last selected line: 0
  41. -- icon id / first selected line: 0 / 0
  42. -- text alignment: 1
  43. -- font id: 0
  44. -- text size: 12
  45. -- style flags: 0
  46. -- line height: 16
  47. -- part name: Next Problem
  48. ----- HyperTalk script -----
  49. on mouseUp
  50.   if field "Flag" = 0 then exit mouseUp
  51.   show button "Smiley"
  52.   show button "Frowney"
  53.   put empty into field "Comment"
  54.   put "  " into field "Minuend"
  55.   put "  " into field "Subtrahend"
  56.   put empty into field "Difference"
  57.   put "  " into num2
  58.   if field "Attempts" = second word of bkgnd field "Options" then
  59.     put field "Attempts" into attempts
  60.     put field "Correct" into correct
  61.     put field "Percent" into percent
  62.     put field "Name" into name
  63.     put third word of field "Options" into skill
  64.     put "O" into field "Attempts"
  65.     put "O" into field "Correct"
  66.     put "O" into field "Percent"
  67.     set the lockScreen to true
  68.     set the cursor to 4
  69.     go to first card of bkgnd "Users"
  70.     rotateData
  71.     put name into line 1 of field "name"
  72.     put the date into line 1 of field "Date"
  73.     put skill into line 1 of field "Skill"
  74.     put attempts into line 1 of field "Attempts"
  75.     put correct into line 1 of field "Correct"
  76.     put percent into line 1 of field "Percent"
  77.     pop card
  78.     exit mouseUp
  79.   end if
  80.   get the random of 70
  81.   add 9 to it
  82.   if second char of it < 2 then add 2 to it
  83.   put it into num1
  84.   if second char of num1 >1 then
  85.     put 10 into it
  86.     subtract second char of num1 from it
  87.     put it into lowerBound
  88.     if it >1 then
  89.       repeat until it > lowerBound
  90.         get the random of 9
  91.       end repeat
  92.     else
  93.       get the random of 9
  94.       add 1 to it
  95.     end if
  96.   else
  97.     put 9 into it
  98.   end if
  99.   put it into second char of num2
  100.   put 7 into it
  101.   subtract first char of num1 from it
  102.   if it >0 then get the random of it else put 1 into it
  103.   put it into first char of num2
  104.   put num1 into num3
  105.   add num2 to num3
  106.   put num3 into field "Minuend"
  107.   put num2 into field "Subtrahend"
  108.   put "   " into field "Difference"
  109.   put "0" into field "Flag"
  110.   put "?" into char 3 of field "Difference"
  111. end mouseUp
  112.  
  113. on rotateData
  114.   repeat with x = 11 down to 1
  115.     if line x of field "Name" is empty then next repeat
  116.     put x into nextLine
  117.     add 1 to nextLine
  118.     get line x of field "Name"
  119.     put it into line nextLine of field "Name"
  120.     get line x of field "Date"
  121.     put it into line nextLine of field "Date"
  122.     get line x of field "Skill"
  123.     put it into line nextLine of field "Skill"
  124.     get line x of field "Attempts"
  125.     put it into line nextLine of field "Attempts"
  126.     get line x of field "Correct"
  127.     put it into line nextLine of field "Correct"
  128.     get line x of field "Percent"
  129.     put it into line nextLine of field "Percent"
  130.   end repeat
  131. end rotateData
  132.  
  133.  
  134.  
  135.  
  136. -- part 4 (button)
  137. -- low flags: 00
  138. -- high flags: 8003
  139. -- rect: left=355 top=161 right=194 bottom=388
  140. -- title width / last selected line: 0
  141. -- icon id / first selected line: 0 / 0
  142. -- text alignment: 1
  143. -- font id: 0
  144. -- text size: 12
  145. -- style flags: 0
  146. -- line height: 16
  147. -- part name: 7
  148. ----- HyperTalk script -----
  149. on mouseUp
  150.   repeat with x=3 down to 2
  151.     if char x of field "Difference" is "?" then
  152.       put "7" into char x of field "Difference"
  153.       put x into it
  154.       subtract 1 from it
  155.       if  x>2 then put "?" into char it of field "Difference"
  156.       exit mouseUp
  157.     end if
  158.   end repeat
  159. end mouseUp
  160.  
  161.  
  162.  
  163. -- part 5 (button)
  164. -- low flags: 00
  165. -- high flags: 8003
  166. -- rect: left=395 top=161 right=194 bottom=427
  167. -- title width / last selected line: 0
  168. -- icon id / first selected line: 0 / 0
  169. -- text alignment: 1
  170. -- font id: 0
  171. -- text size: 12
  172. -- style flags: 0
  173. -- line height: 16
  174. -- part name: 8
  175. ----- HyperTalk script -----
  176. on mouseUp
  177.   repeat with x=3 down to 2
  178.     if char x of field "Difference" is "?" then
  179.       put "8" into char x of field "Difference"
  180.       put x into it
  181.       subtract 1 from it
  182.       if  x>2 then put "?" into char it of field "Difference"
  183.       exit mouseUp
  184.     end if
  185.   end repeat
  186. end mouseUp
  187.  
  188.  
  189.  
  190. -- part 6 (button)
  191. -- low flags: 00
  192. -- high flags: 8003
  193. -- rect: left=435 top=162 right=194 bottom=467
  194. -- title width / last selected line: 0
  195. -- icon id / first selected line: 0 / 0
  196. -- text alignment: 1
  197. -- font id: 0
  198. -- text size: 12
  199. -- style flags: 0
  200. -- line height: 16
  201. -- part name: 9
  202. ----- HyperTalk script -----
  203. on mouseUp
  204.   repeat with x=3 down to 2
  205.     if char x of field "Difference" is "?" then
  206.       put "9" into char x of field "Difference"
  207.       put x into it
  208.       subtract 1 from it
  209.       if  x>2 then put "?" into char it of field "Difference"
  210.       exit mouseUp
  211.     end if
  212.   end repeat
  213. end mouseUp
  214.  
  215.  
  216.  
  217. -- part 7 (button)
  218. -- low flags: 00
  219. -- high flags: 8003
  220. -- rect: left=356 top=201 right=233 bottom=389
  221. -- title width / last selected line: 0
  222. -- icon id / first selected line: 0 / 0
  223. -- text alignment: 1
  224. -- font id: 0
  225. -- text size: 12
  226. -- style flags: 0
  227. -- line height: 16
  228. -- part name: 4
  229. ----- HyperTalk script -----
  230. on mouseUp
  231.   repeat with x=3 down to 2
  232.     if char x of field "Difference" is "?" then
  233.       put "4" into char x of field "Difference"
  234.       put x into it
  235.       subtract 1 from it
  236.       if  x>2 then put "?" into char it of field "Difference"
  237.       exit mouseUp
  238.     end if
  239.   end repeat
  240. end mouseUp
  241.  
  242.  
  243.  
  244. -- part 8 (button)
  245. -- low flags: 00
  246. -- high flags: 8003
  247. -- rect: left=395 top=202 right=234 bottom=428
  248. -- title width / last selected line: 0
  249. -- icon id / first selected line: 0 / 0
  250. -- text alignment: 1
  251. -- font id: 0
  252. -- text size: 12
  253. -- style flags: 0
  254. -- line height: 16
  255. -- part name: 5
  256. ----- HyperTalk script -----
  257. on mouseUp
  258.   repeat with x=3 down to 2
  259.     if char x of field "Difference" is "?" then
  260.       put "5" into char x of field "Difference"
  261.       put x into it
  262.       subtract 1 from it
  263.       if  x>2 then put "?" into char it of field "Difference"
  264.       exit mouseUp
  265.     end if
  266.   end repeat
  267. end mouseUp
  268.  
  269.  
  270.  
  271. -- part 9 (button)
  272. -- low flags: 00
  273. -- high flags: 8003
  274. -- rect: left=435 top=201 right=233 bottom=466
  275. -- title width / last selected line: 0
  276. -- icon id / first selected line: 0 / 0
  277. -- text alignment: 1
  278. -- font id: 0
  279. -- text size: 12
  280. -- style flags: 0
  281. -- line height: 16
  282. -- part name: 6
  283. ----- HyperTalk script -----
  284. on mouseUp
  285.   repeat with x=3 down to 2
  286.     if char x of field "Difference" is "?" then
  287.       put "6" into char x of field "Difference"
  288.       put x into it
  289.       subtract 1 from it
  290.       if  x>2 then put "?" into char it of field "Difference"
  291.       exit mouseUp
  292.     end if
  293.   end repeat
  294. end mouseUp
  295.  
  296.  
  297.  
  298. -- part 10 (button)
  299. -- low flags: 00
  300. -- high flags: 8003
  301. -- rect: left=356 top=242 right=274 bottom=389
  302. -- title width / last selected line: 0
  303. -- icon id / first selected line: 0 / 0
  304. -- text alignment: 1
  305. -- font id: 0
  306. -- text size: 12
  307. -- style flags: 0
  308. -- line height: 16
  309. -- part name: 1
  310. ----- HyperTalk script -----
  311. on mouseUp
  312.   repeat with x=3 down to 2
  313.     if char x of field "Difference" is "?" then
  314.       put "1" into char x of field "Difference"
  315.       put x into it
  316.       subtract 1 from it
  317.       if  x>2 then put "?" into char it of field "Difference"
  318.       exit mouseUp
  319.     end if
  320.   end repeat
  321. end mouseUp
  322.  
  323.  
  324.  
  325. -- part 11 (button)
  326. -- low flags: 00
  327. -- high flags: 8003
  328. -- rect: left=395 top=241 right=273 bottom=428
  329. -- title width / last selected line: 0
  330. -- icon id / first selected line: 0 / 0
  331. -- text alignment: 1
  332. -- font id: 0
  333. -- text size: 12
  334. -- style flags: 0
  335. -- line height: 16
  336. -- part name: 2
  337. ----- HyperTalk script -----
  338. on mouseUp
  339.   repeat with x=3 down to 2
  340.     if char x of field "Difference" is "?" then
  341.       put "2" into char x of field "Difference"
  342.       put x into it
  343.       subtract 1 from it
  344.       if  x>2 then put "?" into char it of field "Difference"
  345.       exit mouseUp
  346.     end if
  347.   end repeat
  348. end mouseUp
  349.  
  350.  
  351.  
  352. -- part 12 (button)
  353. -- low flags: 00
  354. -- high flags: 8003
  355. -- rect: left=436 top=242 right=274 bottom=468
  356. -- title width / last selected line: 0
  357. -- icon id / first selected line: 0 / 0
  358. -- text alignment: 1
  359. -- font id: 0
  360. -- text size: 12
  361. -- style flags: 0
  362. -- line height: 16
  363. -- part name: 3
  364. ----- HyperTalk script -----
  365. on mouseUp
  366.   repeat with x=3 down to 2
  367.     if char x of field "Difference" is "?" then
  368.       put "3" into char x of field "Difference"
  369.       put x into it
  370.       subtract 1 from it
  371.       if  x>2 then put "?" into char it of field "Difference"
  372.       exit mouseUp
  373.     end if
  374.   end repeat
  375. end mouseUp
  376.  
  377.  
  378.  
  379. -- part 13 (button)
  380. -- low flags: 00
  381. -- high flags: 8003
  382. -- rect: left=355 top=281 right=313 bottom=407
  383. -- title width / last selected line: 0
  384. -- icon id / first selected line: 0 / 0
  385. -- text alignment: 1
  386. -- font id: 0
  387. -- text size: 12
  388. -- style flags: 0
  389. -- line height: 16
  390. -- part name: 0
  391. ----- HyperTalk script -----
  392. on mouseUp
  393.   repeat with x=3 down to 2
  394.     if char x of field "Difference" is "?" then
  395.       put "0" into char x of field "Difference"
  396.       put x into it
  397.       subtract 1 from it
  398.       if  x>2 then put "?" into char it of field "Difference"
  399.       exit mouseUp
  400.     end if
  401.   end repeat
  402. end mouseUp
  403.  
  404.  
  405.  
  406. -- part 14 (button)
  407. -- low flags: 00
  408. -- high flags: 8003
  409. -- rect: left=414 top=281 right=313 bottom=468
  410. -- title width / last selected line: 0
  411. -- icon id / first selected line: 0 / 0
  412. -- text alignment: 1
  413. -- font id: 0
  414. -- text size: 12
  415. -- style flags: 0
  416. -- line height: 16
  417. -- part name: Enter
  418. ----- HyperTalk script -----
  419. on mouseUp
  420.   global answer
  421.   if field "Difference" < 1 then exit mouseUp
  422.   if field "Flag" > 0 then exit mouseUp
  423.   put field "Minuend" into answer
  424.   Subtract field "Subtrahend" from answer
  425.   add 1 to field "Attempts"
  426.   if field "Difference" = answer then
  427.     add 1 to field "Correct"
  428.     get field "Correct"
  429.     divide it by field "Attempts"
  430.     multiply it by 100
  431.     put round(it) into field "Percent"
  432.     celebrate
  433.   else
  434.     get field "Correct"
  435.     divide it by field "Attempts"
  436.     multiply it by 100
  437.     put round(it) into field "Percent"
  438.     nag
  439.   end if
  440. end mouseUp
  441.  
  442. on celebrate
  443.   put "Correct" into line 1 of field "Comment"
  444.   put first word of bkgnd field "Name" into line 2 of field "Comment"
  445.   hide button "Smiley"
  446.   put "1" into field "Flag"
  447.   if first word of bkgnd field "Options" = "Y" then
  448.     play "Harpsichord" tempo 200 "g4e c5 e gh eq gh"
  449.   end if
  450. end celebrate
  451.  
  452. on nag
  453.   global answer
  454.   put "WRONG!" into line 1 of field "Comment"
  455.   put "The answer is "& answer & "." into line 3 of field "Comment"
  456.   hide button "Frowney"
  457.   put "2" into field "Flag"
  458.   if first word of bkgnd field "Options" = "Y" then
  459.     play "boing" tempo 200 "gq c e a"
  460.   end if
  461. end nag
  462.  
  463.  
  464.  
  465. -- part contents for background part 2
  466. ----- text -----
  467. O
  468.  
  469. -- part contents for background part 3
  470. ----- text -----
  471. O
  472.  
  473. -- part contents for background part 4
  474. ----- text -----
  475. O
  476.  
  477. -- part contents for background part 5
  478. ----- text -----
  479.   
  480.  
  481. -- part contents for background part 6
  482. ----- text -----
  483.   
  484.  
  485. -- part contents for background part 9
  486. ----- text -----
  487. 1
  488.  
  489. -- part contents for background part 10
  490. ----- text -----
  491. Y 10 5
  492.  
  493. -- part contents for background part 11
  494. ----- text -----
  495. Larry